#!/bin/sh
#
#  Copyright (c) 1990-1998 Enlighten Software Solutions, Inc.
#
#  Example of automatically notifing users when their mailbox is too big
#  Create a new test using one of the "api" groups:
#    1. edit crontab and have this run daily: 
#          ls -l /usr/spool/mail | grep -v total > /mailboxes
#    2. configure one of AgentMon's 'api' groups:
#         Testname: api1  (or any other valid api group name)
#         data=5          (mailbox sizes. May be in differant field on your OS)
#         lable=9         (or whatever field the box owner's name is in)
#         testfreq=1440   (check daily, i.e. every 1440 minutes)
#         notify=$ENLIGHTEN/agent/policy/mbox2big
#
#  DISCLAIMER :
#     THIS PROGRAM IS ONLY AN EXAMPLE. IT IS UNSUPPORTED AND NOT INTENDED
#     FOR ACTUAL USE.  IF YOU DECIDE YOU MAY WANT TO EXECUTE THIS PROGRAM,
#     YOU ARE STRONGLY URGED TO FIRST VERIFY IT'S SUITABLITY AND BEHAVIOR. 
#     
# TESTNAME=$1
# VALUE=$2
# UNITS=$3
# ALARM=$4
# TIME=$5
NAME=$UNITS
mail $NAME << 'WARNING_EOF' > ck &&

   The system has noticed that your mailbox has become rather large.
   Please delete any old messages so we can reclain the disk space.
   This is an automated message sent on behalf of your systems administrator
   (who has also been notified).

WARNING_EOF
#
echo $NAME 'was warned  on '`date` >> /usr/adm/bigmboxes
#
# DONE
